<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/7 0007
  Time: 16:52下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<%  //第二次访问
    //读取cookie，拿出VIP
    String name="";
    String pwd="";
    if (request.getCookies()!=null){
        Cookie[] cookies= request.getCookies();
            for (Cookie c:cookies){
                //System.out.println(c.getName()+"======"+c.getValue());
                if (c.getName().equals("uname")){
                    name=c.getValue();
                }
                if (c.getName().equals("upwd")){
                    pwd=c.getValue();
                }
            }
    }
%>
<body>
<form action="logincookieservlet" method="get">
    <table>
        <tr>
            <td>用户名</td>
            <td><input type="text" id="name" name="name" value="<%=name%>"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="password" id="pwd" name="pwd" value="<%=pwd%>"></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="登陆"></td>
        </tr>
    </table>
</form>
</body>
</html>
